package com.qf.hospital.service.impl;

import com.qf.hospital.controller.MainController;
import com.qf.hospital.entity.ReportExample;
import com.qf.hospital.mapper.ReportMapper;
import com.qf.hospital.service.ReportService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ASUS
 * @version V1.0
 * @Project hospital
 * @Package com.qf.hospital.service.impl
 * @Date 2021/10/19 18:38
 */
@Service
public class ReportServiceImpl implements ReportService {

    private final int DELETE = 0;

    private Logger log = LoggerFactory.getLogger(ReportServiceImpl.class);

    @Autowired
    private ReportMapper reportMapper;

    /**
     * 门诊总人数
     * @return
     */
    @Override
    public Integer findReportCountTotal() {
        ReportExample reportExample = new ReportExample();
        ReportExample.Criteria criteria = reportExample.createCriteria();
        criteria.andStateNotEqualTo(DELETE);
        long totalSize = reportMapper.countByExample(reportExample);
        return Integer.valueOf(totalSize+"");
    }

    /**
     * 今日门诊总人数
     * @return
     */
    @Override
    public Integer findReportCountCurrent() {
        Integer count = reportMapper.findReportCountByCurrent();
        return count;
    }
}
